<template>
  <div>
    <div>
      <h4 class="boardName" @click="gotoThat">
        产量统计
        <a-icon type="right" />
      </h4>
      <div class=" lightBox production" style="height:380px">
        <linechart
          v-if="chartDatalineobj.expectedData.length > 0"
          :chart-data="chartData"
          :className="'ProducStatistics'"
          :legendShow="false"
          :height="'330px'"
          :str="'个'"
        ></linechart>
        <a-empty style="margin-top:100px" v-else />
      </div>
    </div>
  </div>
</template>

<script>
import linechart from '../../../echartsCom/linechart.vue';

export default {
  name: 'index',
  props: {
    chartDatalineobj: {
      type: Object,
      default: () => {},
    },
  },
  components: {
    linechart,
  },
  data() {
    return {
      //   chartData: {
      //     expectedData: [],
      //     date: [],
      //     name:[]},
    };
  },
  // watch: {
  //   chartDatalineobj(val) {
  //     console.log('^^^^^^^^^^^^^^^^^^^^^');
  //     console.log(val);
  //     this.chartData.expectedData.push(val.expectedData)
  //     this.chartData.date.push(val.date)
  //     this.chartData.name.push('产量')
  //     // this.chartDatalinein(val);
  //   },
  // },
  computed: {
    chartData: function() {
      // let data={
      //   expectedData: [],
      //   date: [],
      //   name:[]
      // }
      // data.expectedData.push(this.chartDatalineobj.expectedData);
      // data.date=this.chartDatalineobj.date;
      return this.chartDatalineobj;
    },
  },
  created() {},
  methods: {
    gotoThat() {
      this.$store.commit('board/HeadNavType', 2);
      localStorage.setItem('navType', 2);
      this.$router.push('/statistics');
    },
  },
};
</script>

<style scoped lang="less">
@import '../../light.less';
</style>
